Skip to content

nvme: retry commands on EAGAIN and EINTR#2797

Closed
igaw wants to merge 2 commits intolinux-nvme:masterfrom
igaw:handle-eintr
Closed

nvme: retry commands on EAGAIN and EINTR#2797
igaw wants to merge 2 commits intolinux-nvme:masterfrom
igaw:handle-eintr

Conversation

@igaw
Copy link
Copy Markdown
Collaborator

@igaw igaw commented May 5, 2025

The kernel started to return EAGAIN and EINTR. It is quiet likely that this was possible before but it happened not so often. Thus for users of nvme-cli it is a behavior change.

The first attempt was to handle this in libnvme itself. But it turns out we can't just blindly retry. It is necessary to check if the user has pressed Ctrl-C to terminate the program. Adding a signal handler inside the library is a no go. Thus add the retry logic to nvme-cli itself.

Fixes: #2760 #2781 #2775

@igaw
Copy link
Copy Markdown
Collaborator Author

igaw commented May 5, 2025

And this also wants

linux-nvme/libnvme@2b30489

reverted.

@ikegami-t
Copy link
Copy Markdown
Contributor

Looks good. (By the way seems the commit changes can be split to some patches.)

igaw added 2 commits May 8, 2025 10:07
Add a helper for catching Ctrl-C from the user.

Signed-off-by: Daniel Wagner <[email protected]>
The kernel started to return EAGAIN and EINTR. It is quiet likely that
this was possible before but it happened not so often. Thus for users
of nvme-cli it is a behavior change.

The first attempt was to handle this in libnvme itself. But it turns out
we can't just blindly retry. It is necessary to check if the user has
pressed Ctrl-C to terminate the program. Adding a signal handler inside
the library is a no go. Thus add the retry logic to nvme-cli itself.

Signed-off-by: Daniel Wagner <[email protected]>
@igaw
Copy link
Copy Markdown
Collaborator Author

igaw commented May 8, 2025

Oh, did something stupid with this PR and now I can't reopen it.

@ikegami-t ikegami-t mentioned this pull request May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression in "nvme connect-all -t tcp" in 2.12

2 participants